<script type="text/html" template lay-done="layui.data.sendParams(d.params)">
  <div class="layui-form" lay-filter="form_lock_task">
    <div class="layui-form-item">
      <label class="layui-form-label">产品ID</label>
      <div class="layui-input-inline">
        <input type="hidden" name="id" value="{{d.params.id || ''}}"/>
        <input type="text" lay-verify="required" name="product_id" value="{{d.params.product_id || '' }}"
               class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">开始时间</label>
        <div class="layui-input-inline">
          <input type="text" id="start_time" class="layui-input" name="start_time" placeholder="任务开始时间"
                 lay-verify="required"
                 autocomplete="off" value="{{d.params.start_time || ''}}">
        </div>
      </div>
      <div class="layui-inline">
        <label class="layui-form-label">截止时间</label>
        <div class="layui-input-inline">
          <input type="text" id="end_time" class="layui-input" name="end_time" placeholder="任务截止时间"
                 lay-verify="required"
                 autocomplete="off" value="{{d.params.end_time || ''}}">
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">价格区间</label>
      <div class="layui-inline" style="width: 100px">
        <input type="text" name="min_price" value="{{d.params.display_min_price || ''}}" lay-verify="required"
               autocomplete="off" placeholder="最低价格" class="layui-input">
      </div>
      <div class="layui-inline">
        ~
      </div>
      <div class="layui-inline" style="width: 100px">
        <input type="text" name="max_price" value="{{d.params.display_max_price || ''}}" lay-verify="required"
               autocomplete="off" placeholder="最高价格" class="layui-input">
      </div>
      <div class="layui-inline layui-word-aux">
        单位: 元
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">锁单账户</label>
      <div class="layui-input-inline">
        <input type="text" name="locker_account" lay-verify="required" placeholder="请输入锁单账户的手机号"
               value="{{d.params.locker_account || ''}}" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">锁定时间</label>
      <div class="layui-input-inline">
        <input type="number" name="lock_minutes" lay-verify="required" value="{{d.params.lock_minutes || ''}}"
               autocomplete="off" class="layui-input">
      </div>
      <div class="layui-inline layui-form-mid layui-word-aux">
        分钟
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-footer">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
          <input type="button" id="submit_lock" lay-submit lay-filter="submit_lock_task" value="确认" class="layui-btn">
        </div>
      </div>
    </div>
  </div>
</script>
<script>
  layui.data.sendParams = function (obj) {
    layui.use([], function () {
      let $ = layui.$
        , form = layui.form
        , admin = layui.admin
        , laydate = layui.laydate

      form.render()

      //日历初始化
      laydate.render({
        elem: '#start_time'
        , type: 'datetime'
      });
      laydate.render({
        elem: '#end_time'
        , type: 'datetime'
      });
    })
  }
</script>
